package SqlDemo;

import java.sql.Connection;
import java.sql.PreparedStatement;


import static SqlDemo.user.getInstace;

public class Update {
    public static void main(String[] args) {
        try {
            Connection con = getInstace();

            String sql="update score set degree = ? where sno= ?";
            PreparedStatement p = con.prepareStatement(sql);
            p.setInt(1,4564);
            p.setString(2,"13");
            int i = p.executeUpdate();
            System.out.println(i == 1?"成功":"不成功");
            con.close();
            p.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
